package com.example.controller;


import com.example.pojo.LoginMsg;
import com.example.pojo.RegisterMsg;
import com.example.pojo.Result;
import com.example.service.RegisterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@CrossOrigin // 允许跨域访问
@RestController
@RequestMapping("/register")
public class RegisterController {

    @Autowired
    private RegisterService registerService;

    @PostMapping
    public Result register(@RequestBody RegisterMsg registerMsg){
        log.info("注册请求参数：{}", registerMsg);
        return registerService.register(registerMsg);

    }
}
